
//  Copyright (C) 2009-2011 Luca Piccioni
// 
//  This program is free software: you can redistribute it and/or modify
//  it under the terms of the GNU General Public License as published by
//  the Free Software Foundation, either version 3 of the License, or
//  (at your option) any later version.
// 
//  This program is distributed in the hope that it will be useful,
//  but WITHOUT ANY WARRANTY; without even the implied warranty of
//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//  GNU General Public License for more details.
// 
//  You should have received a copy of the GNU General Public License
//  along with this program.  If not, see <http://www.gnu.org/licenses/>.

using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Xml.Serialization;

using Derm.Render;
using Derm.Scene;

namespace Derm.Ui
{
	/// <summary>
	/// Generic user interface.
	/// </summary>
	[XmlRoot("UserInterface")]
	public class UserInterface : RenderHierarchy
	{
		#region Constructors & Destructor
		
		/// <summary>
		/// World constructor.
		/// </summary>
		public UserInterface()
		{
			RootNode = new RootObject();
		}
		
		#endregion

		#region User Interface View
		
		/// <summary>
		/// Currently used point of view of this World.
		/// </summary>
		public OrthoCamera UiView
		{
			get { return (mCamera); }
			protected set { mCamera = value; }
		}
		
		/// <summary>
		/// Current camera for viewing the world.
		/// </summary>
		private OrthoCamera mCamera = new OrthoCamera();
		
		#endregion

		#region User Interface Rendering
		
		/// <summary>
		/// UserInterface root object.
		/// </summary>
		/// <remarks>
		/// </remarks>
		protected class RootObject : RenderGraphNode
		{
			#region Constructors & Destructor
			
			/// <summary>
			/// RootObject constructor.
			/// </summary>
			public RootObject()
			{
				DepthTestState sDepthTest = new DepthTestState();

				// Setup depth test (use with glPolygonOffset)
				sDepthTest.Enabled = true;
				sDepthTest.Function = DepthTestState.DepthFunction.Less;
			}
			
			#endregion
		}
		
		#endregion
	}
}
